const { log } = require('console');
const fs = require('fs');
const path = require('path');
const FileName = path.resolve(__dirname, "./myFile/img1.jpeg");


async function test() {
    const stat = await fs.promises.stat(FileName)

    log(stat)
    console.log('是否是目录', stat.isDirectory())
    console.log('是否是文件', stat.isFile())
}
test()